package cn.bincker.csustcj.edu.entity;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class ScoreDetail {
    /**
     * 成绩占比
     */
    private List<ScoreProportion> scoreProportions = new ArrayList<>();
    /**
     * 网课时间
     */
    private String courseWareLearnTime;
    /**
     * 网课成绩
     */
    private Double courseWareLearnScore;
    /**
     * 作业成绩
     */
    private List<HomeworkScore> homeworkScores = new ArrayList<>();
    /**
     * 平时成绩
     */
    private Double usualPerformance;
    /**
     * 期末成绩
     */
    private Double examResult;

    public Double getTotalScore() {
        return courseWareLearnScore + homeworkScores.stream().mapToDouble(HomeworkScore::getScore).sum() + usualPerformance + examResult;
    }
}
